package com.beiye.drivertransport.utils;

/**
 * @author cpacm
 * @date 2017/4/1
 * @desciption helper
 */

public class MusicUtils {


    /**
     * get time from int type to string type
     *
     * @param time
     * @return
     */
    public static String getTime(int time) {
//        int cache = time / 1000;
//        int second = cache % 60;
//        cache = cache / 60;
//        int minute = cache % 60;
//        int hour = cache / 60;
//        StringBuilder timeStamp = new StringBuilder();
//        if (hour > 0) {
//            timeStamp.append(hour);
//            timeStamp.append(":");
//        }
//        if (minute < 10) {
//            timeStamp.append("0");
//        }
//        timeStamp.append(minute);
//        timeStamp.append(":");
//
//        if (second < 10) {
//            timeStamp.append("0");
//        }
//        timeStamp.append(second);
//        return timeStamp;
        time=time/1000;
        String strHour=""+(time/3600);
        String strMinute=""+time/60;
        String strSecond=""+time%60;
        strHour=strHour.length()<2?"0"+strHour:strHour;
        strMinute=strMinute.length()<2?"0"+strMinute:strMinute;
        strSecond=strSecond.length()<2?"0"+strSecond:strSecond;

        return strHour+":"+strMinute+":"+strSecond;
    }
}
